package com.dc.designPattern._21_strategy.impl;

import com.dc.designPattern._21_strategy.impl.fly.FlyNoWay;

/**
 * Description: 策略模式_橡胶鸭（不会飞行）
 * @author: gdc
 * @date: 2021/6/9
 * @version 1.0
 */
public class RubberDuck extends Duck {

    public RubberDuck() {
        super();
        super.setFlyingStragety(new FlyNoWay());
    }

    @Override
    public void display() {
        System.out.println("我是橡胶鸭，全身发黄，嘴巴很红");
    }

    @Override
    public void speak() {
        System.out.println("噶~噶~噶~");
    }
}
